<table class="table table-hover crud">
    <thead>
        <tr>
            <td>名称</td>
            <td>操作</td>
        </tr>
    </thead>
    <tbody>
        <volist name="list" id="item">
        <tr>
            <td>
                <a
                    href="{:U('Manage/' . $child, array(
                        ACTION_NAME => $item['id']))}"
                    id="item-{$item.id}">
                    {$item.name}
                </a>
            </td>
            <td>
                <div class="btn-group">
                    <a
                        href="#modal-edit"
                        class="edit btn btn-mini"
                        data-id="{$item.id}"
                        data-toggle="modal"
                        title="编辑">
                        <i class="icon text-warning icon-pencil"></i>
                    </a>
                    <a
                        href="#modal-delete"
                        class="delete btn btn-mini"
                        data-id="{$item.id}"
                        data-toggle="modal"
                        title="删除">
                        <i class="icon text-error icon-remove"></i>
                    </a>
                </div>
            </td>
        </tr>
        </volist>
        <tr>
            <td></td>
            <td>
                <a
                    class="btn btn-mini add"
                    href="#modal-add"
                    data-toggle="modal">
                    <i class="icon-plus" title="添加"></i>
                </a>
            </td>
        </tr>
    </tbody>
</table>
<div class="modal hide fade" id="modal-add">
    <br>
    <div class="modal-body">
        <form
            action="__SELF__"
            method="POST"
            class="form form-inline">
            <input type="hidden" name="o" value="add">
            <present name="parent">
            <input type="hidden" name="{$parent}_id" value="{$parent_id}">
            </present>
            <input type="text" name="name" id="add-name" placeholder="名称">
            <button type="submit" class="btn btn-primary"><i class="icon-plus"></i> 添加</button>
        </form>
    </div>
</div>
<div class="modal hide fade" id="modal-edit">
    <br>
    <div class="modal-body">
        <form
            action="__SELF__"
            method="POST"
            class="form form-inline">
            <input type="hidden" name="o" value="update">
            <input type="hidden" name="id" id="update-id">
            <input type="text" name="name" id="update-name">
            <button type="submit" class="btn btn-primary"><i class="icon-pencil"></i> 编辑</button>
        </form>
    </div>
</div>
<div class="modal hide fade" id="modal-delete">
    <br>
    <div class="modal-body">
        <form
            action="__SELF__"
            method="POST"
            class="form form-inline">
            <input type="hidden" name="o" value="delete">
            <input type="hidden" name="id" id="delete-id">
            <button type="submit" class="btn btn-danger"><i class="icon-exclamation"></i> 确定删除</button>
        </form>
    </div>
</div>
